<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>title</title>
    <link rel="stylesheet" type="text/css" href="../css/public.css" />
    <style>
       #content {
		width: 100%;
		height: 100vh;
		background-color: #f3f3f3;
	}

	/* 日报 */
	.twoShow {
		width: 100%;
		padding-top: 30px;
	}

	.twoShow .topHad {
		width: 100%;
		height: 30px;
		color: #333333;
		font-size: 12px;
	}

	.twoShow .topHad .left {
		width: 60%;
		height: 100%;
	}

	.twoShow .topHad .right {
		height: 100%;
		padding: 0 10px;
		background-color: #FFF;
		border-radius: 8px;
	}

	.twoShow .topHad .oneLeft {
		width: 42%;
		height: 100%;
		background-color: #FFF;
		border-radius: 8px;
	}

	.topHad .oneLeft img {
		width: 10px;
		height: 5px;
	}

	.moneyLists {
		width: 100%;
		/* height: 650px; */
		margin-top: 20px;
	}

	.moneyLists .oneTime {
		width: calc(100% - 20px);
		height: 55px;
		background-color: #FFF;
		margin-bottom: 10px;
		padding: 0 10px;
	}
	.moneyLists .oneTime .two {
		width: 30%;
		height: 100%;
		line-height: 55px;
	}

	.moneyLists .oneTime .two .one {
		width: 90%;
		height: 100%;
	}
	.oneTime .one {
		width: 30%;
		height: 100%;
		line-height: 55px;
	}

	.moneyLists .centerOne {
		width: 30%;
		height: 100%;
	}
	.null {
		width: 120px;
		height: 100px;
		position: absolute;
		top: 60px;
		left: 50%;
		transform: translate(-50%, 100px);
	}

	.null img {
		width: 100%;
		height: 80px;
		margin-bottom: 10px;
	}

	.null p {
		font-size: 17px;
		color: #DDDDDD;
		font-weight: bold;
	}
    </style>
</head>

<body>
    <div id="content">
		
<!-- 日报 -->
		<div class="twoShow flex_column">
			<div class="topHad flex_around">
				<div class="left flex">
					<div class="oneLeft flex_around">
						<p id="dayjdatas">{{dayjdatas}}</p>
						<img src="../image/img/invite/bott.png" alt="">
					</div>
					<p style="margin: 0 15px; font-weight: bold;">~</p>
					<div class="oneLeft flex_around">
						<p id="dayjdatae">{{dayjdatae}}</p>
						<img src="../image/img/invite/bott.png" alt="">
					</div>
				</div>

				<div class="right flex_end">
					<p style="margin-right: 5px;" onclick="_ziji()">{{ziji[0].name}}</p>
					<img src="../image/img/invite/bott.png" alt="" style="width: 10px;height: 5px;">
				</div>
			</div>

			<div class="null flex_column_center" v-if="!daydataarr.length">
				<img src="../image/img/invite/null.png" alt="">
				<p>暂无数据</p>
			</div>
			<div class="moneyLists " v-if="daydataarr.length">
				
				<div v-for="(m, index) in daydataarr" v-if="ziji[0].id==0" class="flex_column">
					<div class="oneTime flex_around" v-for="(item, index) in m" >
						<div class="two flex">
							
							<p class="one" style="text-align: center;font-size: 14px">{{item.time}}</p>
						</div>

						<div class="centerOne flex_column_center">
							<p style="font-size: 14px;">{{item.money}}</p>
							<p style="font-size: 10px;color: #999999;">总收益(积分)</p>
						</div>
						<p class="one" style="text-align: right;font-size: 12px;color: #7489A6;">{{item.name}}</p>
					</div>
				</div>
					
			

				<div v-for="(m, index) in daydataarr" v-if="ziji[0].id==1" class="flex_column">
					<div class="oneTime flex_around" >
						<div class="two flex">
							
							<p class="one" style="text-align: center;font-size: 14px;">{{m.time}}</p>
						</div>

						<div class="centerOne flex_column_center">
							<p style="font-size: 14px;">{{m.money}}</p>
							<p style="font-size: 10px;color: #999999;">总收益(积分)</p>
						</div>
						<p class="one" style="text-align: right;font-size: 12px;color: #7489A6;">{{m.name}}</p>
					</div>
				</div>
			</div>

		</div>








	</div>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/jquery.js"></script>
<script type="text/javascript" src="../script/vue.js"></script>
<script type="text/javascript" src="../script/ffkj.js"></script>
<script type="text/javascript" src="../script/update.js"></script>
<script type="text/javascript" src="../script/swiper.js"></script>
<script type="text/javascript" src="../script/jdate.min.js"></script>
<script src="../script/select_json.js"></script>
<script type="text/javascript" src="../json/imglist.js"></script>
<script type="text/javascript" src="../json/user.js"></script>
<script type="text/javascript" src="../json/rw.js"></script>
<script type="text/javascript">
    var userid;
    var view = new Vue({
        el: '#content',
        data: {
			ziji:[{"name":'好友',"id":0}],
			dayjdatas:'',
			dayjdatae:'',
			daydataarr:[],
        },
        methods: {
        }
    });

    apiready = function() {
        view.ios = $api.getStorage('shang');
        userid = $api.getStorage('userid');
    	view.user=$api.getStorage('user');

		var dat=new Date()
		var year = dat.getFullYear();
		var mon = (dat.getMonth()+1) < 10 ? "0"+(dat.getMonth()+1) : dat.getMonth()+1;
		var data = dat.getDate()  < 10 ? "0"+(dat.getDate()) : dat.getDate();
		view.dayjdatas=year +"-"+ mon +"-"+ data
		view.dayjdatae=year +"-"+ mon +"-"+ data

		
			new Jdate({
				el: '#dayjdatas',
				format: 'YYYY-MM-DD',
				beginYear: 2000,
				endYear: 2100,
				confirm: function(date) {
					view.dayjdatas=date
					_daydata()
				}
			})
			new Jdate({
				el: '#dayjdatae',
				format: 'YYYY-MM-DD',
				beginYear: 2000,
				endYear: 2100,
				confirm: function(date) {
					view.dayjdatae=date
					_daydata()
				}
			})

			_daydata()
    };

	

	function _ziji(){
		var path=[{"name":'好友',"id":0},{"name":view.user.name,"id":1}];
		openUIActionSelector(path, {
        col: 1,
        title: '对象'
    }, function (ret, err) {
        console.log(JSON.stringify(ret))
		if(ret.eventType=='ok'){
		view.ziji=ret.selectedInfo
		_daydata()
		}
	})
	}
	
	function _daydata() {
        _ajax('api/User/ribaodata', function(ret, err) {
            if (ret && ret.data) {
				view.daydataarr=ret.data
            }else{
				_msg(ret.msg)
			}
        },{
			user_id: $api.getStorage('userid'),
			days:view.dayjdatas,
			daye:view.dayjdatae,
			user:view.ziji[0].id
		})
    }
	

</script>

</html>